Øyvind Kolås [Tue, 28 May 2019 23:58:30 +0000 (01:58 +0200)]
babl: implement babl_space_get_rgb_luminance
This provides the factors often found as defines hard-coded for sRGB
with values that are adapted to the primaries of the RGB family of
pixel encodings for a given babl space.
Øyvind Kolås [Thu, 6 Dec 2018 18:19:40 +0000 (19:19 +0100)]
babl: make babl_format_with_space not crash with palette based formats
Now, both palettes referred to by their string name and palettes passed
directly in with a cast get passed through without modification, for
correct behavior their palette entries should also be re-created
(the only way to read out the palette is currently to do an exhaustive buffer
conversion.)
Øyvind Kolås [Thu, 6 Dec 2018 16:06:28 +0000 (17:06 +0100)]
babl: special case palette formats in babl_format_with_space
For now, re-return the original passed in format, this will as
a starter not crash - while the color management is non-functional;
the special casing will be made more elaborate with space support
in babl-palette.
Øyvind Kolås [Thu, 6 Dec 2018 09:29:01 +0000 (10:29 +0100)]
tests: fix bit-rot in palette tests
Update to use R'G'B' u8 formats, which is what is now used internally
as well well, along with updating to use the current way of creating
formats with/without transparency.
Øyvind Kolås [Mon, 3 Dec 2018 23:18:47 +0000 (00:18 +0100)]
cairo: make mapping of cmyk subset easier
Make the mapping be RGB = CMK and RGB = CYK, only magenta and yellow
vary between them and the order remains the same, making it easier to
spot inconsitencies in code.
Øyvind Kolås [Mon, 3 Dec 2018 23:04:45 +0000 (00:04 +0100)]
cairo: move CMYK extension formats here
This adds new endian-aware formats cairo-ACMK32 and cairo-ACKY32 which are
derived from babl_format("camayakaA u8") - converting succesively with these
two formats to this format or other sharing the model permits rebuilding a
complete CMYKA image.
Øyvind Kolås [Mon, 3 Dec 2018 18:08:02 +0000 (19:08 +0100)]
babl: do not synthesize missing components
This permits copying to a complete format from a reduced set, only
setting the defined components. Earlier this could be achieved by
using a format with PAD for the components.
Øyvind Kolås [Tue, 27 Nov 2018 02:37:10 +0000 (03:37 +0100)]
babl: decrease tolerance
The following conversion is undesirable, going via linear u16 on the
way to a different TRC u16 amount of quantization should be considered
bad enough to be avoided.
chosen RGBA u32 to R'G'B'A u16: steps: 4 error: 0.000005 cost: 876.000000
/usr/local/lib/babl-0.1/u32.so 0: RGBA u32 to RGBA u16
/usr/local/lib/babl-0.1/gggl-table-lies.so 0: RGBA u16 to RGBA float
/usr/local/lib/babl-0.1/sse2-float.so 0: RGBA float to R'G'B'A float
/usr/local/lib/babl-0.1/gggl.so 0: R'G'B'A float to R'G'B'A u16
This is slower but more correct:
chosen RGBA u32 to R'G'B'A u16: steps: 3 error: 0.000000 cost: 1051.000000
/usr/local/lib/babl-0.1/simple.so 0: RGBA u32 to RGBA float
/usr/local/lib/babl-0.1/sse2-float.so 0: RGBA float to R'G'B'A float
/usr/local/lib/babl-0.1/gggl.so 0: R'G'B'A float to R'G'B'A u16
Øyvind Kolås [Mon, 26 Nov 2018 22:39:08 +0000 (23:39 +0100)]
babl: add bitmask flags for meta-data about models
Refactored from new API needed internally for knowing if a model is CMYK based
or not, this permits adding meta-data that can be quickly figured out in
possible fast code paths. The API is not complete, and it probably doesn't harm
to include as many features from different models as possible that fit in a
bitmask, adding the most important ones first and maintaining the order of the
enum will ensure API compatibility once it is in a release.
Øyvind Kolås [Mon, 12 Nov 2018 22:35:31 +0000 (23:35 +0100)]
babl: implement CMYK color model in reference and base
This commit adds support to the reference fishes of babl to deal
with CMYK based pixel format encodings, backed by babl spaces with
ICC CMYK ICC profiles.
Øyvind Kolås [Fri, 16 Nov 2018 17:27:32 +0000 (18:27 +0100)]
babl: properly cache runtime inserted conversions
The old behavior of avoiding colliding names used in the conversion database
is still used during loading of extension permitting multiple conversions
to be registered for runtime profiling.